package com.twu.biblioteca.commands;

//import com.twu.biblioteca.IOStream.CustomerInputStream;
//import com.twu.biblioteca.IOStream.CustomerOutputStream;
import com.twu.biblioteca.IOStream.Message;
import com.twu.biblioteca.library.Library;

import java.io.IOException;

public class LoginCommand implements ICommand{

    private int commandId;
    private String username;
    private String password;

    public LoginCommand(int commandId, String username, String password) {
        this.commandId = commandId;
        this.username = username;
        this.password = password;
    }

    public String toString() {
        return "log in";
    }

    public void execute(Library library) throws IOException {
        Message message = library.customerLoginMessage(username, password);
        library.getIo().outputCommand(message);
    }

    public int getCommandId() {
        return commandId;
    }

}
